﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using Poem.Application.Dtos;
using Poem.Application.Services;

namespace Poem.Web.Pages
{
    public class IndexModel : PageModel
    {
        private readonly ILogger<IndexModel> _logger;
        private readonly IPoemAppService _poemAppService;

        public List<CategoryDto> categories;

        public IndexModel(IPoemAppService poemAppService, ILogger<IndexModel> logger)
        {
            _poemAppService = poemAppService;
            _logger = logger;
        }
        
        public void OnGet()
        {
            categories = _poemAppService.GetAllCategories();
        }
    }
}
